MenuHost

interface MenuHost(source)

A class that allows you to host and keep track of MenuProviders that will supply android.view.MenuItems to the app bar.

See also

Functions

Link copied to clipboard
abstract fun addMenuProvider(@NonNull provider: MenuProvider)
abstract fun addMenuProvider(@NonNull provider: MenuProvider, @NonNull owner: LifecycleOwner)
Adds the given MenuProvider to this MenuHost.
abstract fun addMenuProvider(@NonNull provider: MenuProvider, @NonNull owner: LifecycleOwner, @NonNull state: Lifecycle.State)
Adds the given MenuProvider to this MenuHost once the given LifecycleOwner reaches the given Lifecycle.State.
Link copied to clipboard
abstract fun invalidateMenu()
Invalidates the android.view.Menu to ensure that what is displayed matches the current internal state of the menu.
Link copied to clipboard
abstract fun removeMenuProvider(@NonNull provider: MenuProvider)
Removes the given MenuProvider from this MenuHost.